#pragma once

// Copyright (c) 2010 Manuel Peinado Gallego <manuel.peinado@gmail.com>
// Distributed under the MIT license

// Pickable.h : interface of the Pickable class
//

#include <alg3d/alg3d.h>
#include "Drawable.h"
#include "Selectable.h"
#include "PickColor.h"


// Abstract class because of Drawable::draw

class Pickable : public Drawable, public Selectable
{

public:

    Pickable();

    // --------------------------------------------------------------

    bool hasPickColor() const;
    void setPickColor(const PickColor & color);
    PickColor getPickColor() const;
    void clearPickColor();

    // --------------------------------------------------------------
    // Returns false

    virtual bool isSelectable() const;


protected:

    PickColor m_pickColor;

    // --------------------------------------------------------------

    void setColorIfNotPicking(View3d * view, 
                              const Color & color) const;
    void setColorOrPickCode(View3d * view, const Color & color,
                            GLubyte pickCode) const;

};
